/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file SCWindow.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef SCWINDOW_H_
#define SCWINDOW_H_

#include "models/SCBaseModel.h"
#include "models/SCSample.h"

class SCWindow : public SCBaseModel
{
// Construct
public:
	SCWindow();
	virtual ~SCWindow();
	result Construct();

// Constants

// Attributes
private:
	//int energy;
	int windowSize;
	Queue window;
	SCSample* pMaxEnergy;
	SCSample* pMinEnergy;
	double energySum;
	double sampleCount;
	SCSample* pLastSample;
	SCSample* pResampledSample;
	int resampledCount;

// Methods
public:
	//void SetEnergy(int energy);
	//int GetEnergy();
	void SetWindowSize(int size);
	int GetWindowSize();
	void SetWindow(Queue* pWindow);
	Queue* GetWindow();
	void SetPMaxEnergy(SCSample* pSample);
	SCSample* GetPMaxEnergy();
	void SetPMinEnergy(SCSample* pSample);
	SCSample* GetPMinEnergy();
	void SetEnergySum(double value);
	double GetEnergySum();
	void SetSampleCount(double value);
	double GetSampleCount();
	void SetLastSample(SCSample* pSample);
	SCSample* GetLastSample();
	void AddSample(SCSample *pSample, Float *pSampleEnergy);
	void RemoveSample(int id);
	float ComputeEnergy(SCSample* pLastSample, SCSample* pCurrentSample);
	void SetNextPart();
	void SetExtremePoints(SCSample* pSample);
	void SetDefaultValues();
	void SaveSample(SCSample* pSample);
	bool Load();
	bool Save();
};

#endif /* SCWINDOW_H_ */
